package com.organization

class Project {

	String  name
    Date    startDate
    Date    dueDate
    String  description
	
	static belongsTo = [department:Department]
	static hasMany = [employees: Employee]

    static constraints = {
		name(blank:false,size:3..20)
        startDate(nullable:false)
        dueDate(nullable:true)
        description(nullable:true, maxSize:20)

    }

    static mapping = {
        employees cascade: 'all-delete-orphan'
    }

	String toString(){
		return name;
	}
}
